﻿using System;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Effects;

namespace MoonyWeather
{
    class BlurInvertEffect : ShaderEffect
    {
        public BlurInvertEffect()
        {
            PixelShader = _shader;
            UpdateShaderValue(InputProperty);
        }

        public Brush Input
        {
            get { return (Brush)GetValue(InputProperty); }
            set { SetValue(InputProperty, value); }
        }

        public static readonly DependencyProperty InputProperty =
            ShaderEffect.RegisterPixelShaderSamplerProperty(
                    "Input",
                    typeof(BlurInvertEffect),
                    0);
        
        private static PixelShader _shader =
            new PixelShader() { UriSource = new Uri(@"pack://application:,,,/MoonyWeather;component/blurinv.ps") };
    }
}
